package com.ruoyi.yf.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.yf.mapper.YfInterfaceMapper;
import com.ruoyi.yf.domain.YfInterface;
import com.ruoyi.yf.service.IYfInterfaceService;
import com.ruoyi.common.core.text.Convert;

/**
 * 医废接口Service业务层处理
 * 
 * @author XiaoYi...
 * @date 2020-07-13
 */
@Service("yfInterfaceService")
public class YfInterfaceServiceImpl implements IYfInterfaceService 
{
    @Autowired
    private YfInterfaceMapper yfInterfaceMapper;

    /**
     * 查询医废接口
     * 
     * @param interfaceId 医废接口ID
     * @return 医废接口
     */
    @Override
    public YfInterface selectYfInterfaceById(Long interfaceId)
    {
        return yfInterfaceMapper.selectYfInterfaceById(interfaceId);
    }

    /**
     * 查询医废接口列表
     * 
     * @param yfInterface 医废接口
     * @return 医废接口
     */
    @Override
    public List<YfInterface> selectYfInterfaceList(YfInterface yfInterface)
    {
        return yfInterfaceMapper.selectYfInterfaceList(yfInterface);
    }

    /**
     * 新增医废接口
     * 
     * @param yfInterface 医废接口
     * @return 结果
     */
    @Override
    public int insertYfInterface(YfInterface yfInterface)
    {
        yfInterface.setCreateTime(DateUtils.getNowDate());
        return yfInterfaceMapper.insertYfInterface(yfInterface);
    }

    /**
     * 修改医废接口
     * 
     * @param yfInterface 医废接口
     * @return 结果
     */
    @Override
    public int updateYfInterface(YfInterface yfInterface)
    {
        yfInterface.setUpdateTime(DateUtils.getNowDate());
        return yfInterfaceMapper.updateYfInterface(yfInterface);
    }

    /**
     * 删除医废接口对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteYfInterfaceByIds(String ids)
    {
        return yfInterfaceMapper.deleteYfInterfaceByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除医废接口信息
     * 
     * @param interfaceId 医废接口ID
     * @return 结果
     */
    @Override
    public int deleteYfInterfaceById(Long interfaceId)
    {
        return yfInterfaceMapper.deleteYfInterfaceById(interfaceId);
    }
}
